<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/cinema.css"/>
    <script type="text/javascript" src="../js/cinema.js"></script>
    <script src="../jquery-3.6.0.js"></script>
    <title>Document</title>
</head>
<body>
<?php
include("../service/MovieService.php");
?>
<div class="main">
    <div class="main_top">
        <?php
        $movieService = new MovieService();
        $movie_id = $_GET["movie_id"];
        $movieInfo = $movieService->getMovieInfo($movie_id);
        echo "<span>" . $movieInfo[1] . "</span>";
        ?>
        <hr>
        <div class="movie_picture_block">
            <?php
            echo "<img src=" . $movieInfo['picture_url'] . " class='movie_picture'>";
            ?>
        </div>
        <?php
        echo "<span class='dy'>导演：" . $movieInfo[5] . "</span><br>";
        echo "<span class='dy'>上映时间：" . $movieInfo[8] . "</span><br>";
        echo "<span class='dy'>主演：" . $movieInfo[6] . "</span><br>";
        echo "<span class='dy' id='js'>剧情介绍：" . $movieInfo[7] . "</span><br>";

        ?>
    </div>
    <div class="cc">
        <p style="font-size: larger;position: relative;top: -30px">选座购票</p>
        <div class="zone">
            <p style="font-size: larger">选择影院</p>
            <br>
            <p style="font-size: larger">选择时间</p>
        </div>
        <form method="get">
            <input type="hidden" name="cinema_id" class="cinema_id_radio" id="cinema_id" value="1">
            <div id="time">
                <?php
                $aCinema = $movieService->getACinemaInfo();
                //    echo $aCinema[0][1];z

                for ($i = 0; $i < sizeof($aCinema); $i++) {
                    if ($i == 0)
                        echo "<div class='radio selected' onclick='selectRadio(" . ($i + 1) . ")' value='" . $aCinema[$i][0] . "'>" . $aCinema[$i][1] . "</div>";
                    else
                        echo "<div class='radio' onclick='selectRadio(" . ($i + 1) . ")' value='" . $aCinema[$i][0] . "'>" . $aCinema[$i][1] . "</div>";
                }
                echo "<input type='hidden' name='movie_id' value='" . $movie_id . "'>"
                ?>
                <div class="sxjt">
                    <div class="sx">
                        <span class="sx1">
                            放映时间
                        </span>
                        <span class="sx1">
                            选座购票
                        </span>
                    </div>
                    <br>
                    <div class="jt">
                        <span class="jt1">
                            14:30(5月18日)
                        </span>
                        <span class="jt1">
                            <input type='submit' formaction='choose_seat.php?' value='选票'>
                        </span>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>